#!/bin/bash
#

sed '
/the .* statement/{
h
s/.*the \(.*\) statement.*/\1/
y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/
G  
s/\(.*\)\n\(.*the \).*\( statement.*\)/\2\1\3/
}
' /opt/work/homework/data_dxchange.txt
